package net.cassite.daf4j.ds;

/**
 * 打包的整套解释器
 */
public class ParserPacket<Context, BasicElement, DS> {
        public final AndOrParser<Context, BasicElement> andOrParser;
        public final AroundParser<Context, BasicElement, DS> aroundParser;
        public final ConditionParser<Context, BasicElement> conditionParser;
        public final EntityDataParser<Context, BasicElement> entityDataParser;
        public final ExpressionParser<Context, BasicElement> expressionParser;
        public final QueryParameterParser<Context, BasicElement> queryParameterParser;
        public final UpdateEntryParser<Context, BasicElement> updateEntryParser;
        public final TxManager txManager;

        public ConditionResolver<Context, BasicElement> conditionResolver;
        public ExpressionResolver<Context, BasicElement> expressionResolver;
        public ObjectResolver<Context, BasicElement> objectResolver;

        public ParserPacket(AndOrParser<Context, BasicElement> andOrParser,
                            AroundParser<Context, BasicElement, DS> aroundParser,
                            ConditionParser<Context, BasicElement> conditionParser,
                            EntityDataParser<Context, BasicElement> entityDataParser,
                            ExpressionParser<Context, BasicElement> expressionParser,
                            QueryParameterParser<Context, BasicElement> queryParameterParser,
                            UpdateEntryParser<Context, BasicElement> updateEntryParser,
                            TxManager txManager) {
                this.andOrParser = andOrParser;
                this.aroundParser = aroundParser;
                this.conditionParser = conditionParser;
                this.entityDataParser = entityDataParser;
                this.expressionParser = expressionParser;
                this.queryParameterParser = queryParameterParser;
                this.updateEntryParser = updateEntryParser;
                this.txManager = txManager;
        }

        void setResolvers(ConditionResolver<Context, BasicElement> conditionResolver,
                          ExpressionResolver<Context, BasicElement> expressionResolver,
                          ObjectResolver<Context, BasicElement> objectResolver) {
                this.conditionResolver = conditionResolver;
                this.expressionResolver = expressionResolver;
                this.objectResolver = objectResolver;
        }
}
